The outputChart component provides a flexible api allowing developers to get the maximum benefit from JCharts charting utility. The outputChart component provides a moderate amount of interfaces to manipulate the chart but there is much more that can be done using the JCharts API.
You can create any type of chart or combined chart using the JCharts API in your bean. You can then pass the custom chart to the outputChart component which will allow the chart to participate in the JSF lifecycle.
The proper place for this operation is in a method binding which is bound with the renderOnSubmit attribute. This tells the component whether to render the chart or not. See the example below:
//JSF
<ice:outputChart type="custom" renderOnSubmit="#{combinedChart.renderOnSubmit}" />
//Bean
public boolean renderOnSubmit(OutputChart component){
try {
.............
.............
org.krysalis.jcharts.axisChart.AxisChart axisChart= new org.krysalis.jcharts.axisChart.AxisChart( ......);
component.setChart(axisChart);
return true;
} catch (Exception e) {
e.printStackTrace();
return false;
}
}